package com.pmsystem.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class KeyRecordExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public KeyRecordExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        protected void addCriterionForJDBCDate(String condition, Date value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value.getTime()), property);
        }

        protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
            Iterator<Date> iter = values.iterator();
            while (iter.hasNext()) {
                dateList.add(new java.sql.Date(iter.next().getTime()));
            }
            addCriterion(condition, dateList, property);
        }

        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
        }

        public Criteria andRecordIdIsNull() {
            addCriterion("record_id is null");
            return (Criteria) this;
        }

        public Criteria andRecordIdIsNotNull() {
            addCriterion("record_id is not null");
            return (Criteria) this;
        }

        public Criteria andRecordIdEqualTo(Integer value) {
            addCriterion("record_id =", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdNotEqualTo(Integer value) {
            addCriterion("record_id <>", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdGreaterThan(Integer value) {
            addCriterion("record_id >", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("record_id >=", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdLessThan(Integer value) {
            addCriterion("record_id <", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdLessThanOrEqualTo(Integer value) {
            addCriterion("record_id <=", value, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdIn(List<Integer> values) {
            addCriterion("record_id in", values, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdNotIn(List<Integer> values) {
            addCriterion("record_id not in", values, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdBetween(Integer value1, Integer value2) {
            addCriterion("record_id between", value1, value2, "recordId");
            return (Criteria) this;
        }

        public Criteria andRecordIdNotBetween(Integer value1, Integer value2) {
            addCriterion("record_id not between", value1, value2, "recordId");
            return (Criteria) this;
        }

        public Criteria andKeyIdIsNull() {
            addCriterion("key_id is null");
            return (Criteria) this;
        }

        public Criteria andKeyIdIsNotNull() {
            addCriterion("key_id is not null");
            return (Criteria) this;
        }

        public Criteria andKeyIdEqualTo(Integer value) {
            addCriterion("key_id =", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdNotEqualTo(Integer value) {
            addCriterion("key_id <>", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdGreaterThan(Integer value) {
            addCriterion("key_id >", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("key_id >=", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdLessThan(Integer value) {
            addCriterion("key_id <", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdLessThanOrEqualTo(Integer value) {
            addCriterion("key_id <=", value, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdIn(List<Integer> values) {
            addCriterion("key_id in", values, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdNotIn(List<Integer> values) {
            addCriterion("key_id not in", values, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdBetween(Integer value1, Integer value2) {
            addCriterion("key_id between", value1, value2, "keyId");
            return (Criteria) this;
        }

        public Criteria andKeyIdNotBetween(Integer value1, Integer value2) {
            addCriterion("key_id not between", value1, value2, "keyId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdIsNull() {
            addCriterion("lend_user_id is null");
            return (Criteria) this;
        }

        public Criteria andLendUserIdIsNotNull() {
            addCriterion("lend_user_id is not null");
            return (Criteria) this;
        }

        public Criteria andLendUserIdEqualTo(Integer value) {
            addCriterion("lend_user_id =", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdNotEqualTo(Integer value) {
            addCriterion("lend_user_id <>", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdGreaterThan(Integer value) {
            addCriterion("lend_user_id >", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("lend_user_id >=", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdLessThan(Integer value) {
            addCriterion("lend_user_id <", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdLessThanOrEqualTo(Integer value) {
            addCriterion("lend_user_id <=", value, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdIn(List<Integer> values) {
            addCriterion("lend_user_id in", values, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdNotIn(List<Integer> values) {
            addCriterion("lend_user_id not in", values, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdBetween(Integer value1, Integer value2) {
            addCriterion("lend_user_id between", value1, value2, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendUserIdNotBetween(Integer value1, Integer value2) {
            addCriterion("lend_user_id not between", value1, value2, "lendUserId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdIsNull() {
            addCriterion("lend_administrator_id is null");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdIsNotNull() {
            addCriterion("lend_administrator_id is not null");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdEqualTo(Integer value) {
            addCriterion("lend_administrator_id =", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdNotEqualTo(Integer value) {
            addCriterion("lend_administrator_id <>", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdGreaterThan(Integer value) {
            addCriterion("lend_administrator_id >", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("lend_administrator_id >=", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdLessThan(Integer value) {
            addCriterion("lend_administrator_id <", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdLessThanOrEqualTo(Integer value) {
            addCriterion("lend_administrator_id <=", value, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdIn(List<Integer> values) {
            addCriterion("lend_administrator_id in", values, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdNotIn(List<Integer> values) {
            addCriterion("lend_administrator_id not in", values, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdBetween(Integer value1, Integer value2) {
            addCriterion("lend_administrator_id between", value1, value2, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendAdministratorIdNotBetween(Integer value1, Integer value2) {
            addCriterion("lend_administrator_id not between", value1, value2, "lendAdministratorId");
            return (Criteria) this;
        }

        public Criteria andLendCauseIsNull() {
            addCriterion("lend_cause is null");
            return (Criteria) this;
        }

        public Criteria andLendCauseIsNotNull() {
            addCriterion("lend_cause is not null");
            return (Criteria) this;
        }

        public Criteria andLendCauseEqualTo(String value) {
            addCriterion("lend_cause =", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseNotEqualTo(String value) {
            addCriterion("lend_cause <>", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseGreaterThan(String value) {
            addCriterion("lend_cause >", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseGreaterThanOrEqualTo(String value) {
            addCriterion("lend_cause >=", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseLessThan(String value) {
            addCriterion("lend_cause <", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseLessThanOrEqualTo(String value) {
            addCriterion("lend_cause <=", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseLike(String value) {
            addCriterion("lend_cause like", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseNotLike(String value) {
            addCriterion("lend_cause not like", value, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseIn(List<String> values) {
            addCriterion("lend_cause in", values, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseNotIn(List<String> values) {
            addCriterion("lend_cause not in", values, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseBetween(String value1, String value2) {
            addCriterion("lend_cause between", value1, value2, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendCauseNotBetween(String value1, String value2) {
            addCriterion("lend_cause not between", value1, value2, "lendCause");
            return (Criteria) this;
        }

        public Criteria andLendTimeIsNull() {
            addCriterion("lend_time is null");
            return (Criteria) this;
        }

        public Criteria andLendTimeIsNotNull() {
            addCriterion("lend_time is not null");
            return (Criteria) this;
        }

        public Criteria andLendTimeEqualTo(Date value) {
            addCriterionForJDBCDate("lend_time =", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeNotEqualTo(Date value) {
            addCriterionForJDBCDate("lend_time <>", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeGreaterThan(Date value) {
            addCriterionForJDBCDate("lend_time >", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("lend_time >=", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeLessThan(Date value) {
            addCriterionForJDBCDate("lend_time <", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeLessThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("lend_time <=", value, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeIn(List<Date> values) {
            addCriterionForJDBCDate("lend_time in", values, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeNotIn(List<Date> values) {
            addCriterionForJDBCDate("lend_time not in", values, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("lend_time between", value1, value2, "lendTime");
            return (Criteria) this;
        }

        public Criteria andLendTimeNotBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("lend_time not between", value1, value2, "lendTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeIsNull() {
            addCriterion("restore_time is null");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeIsNotNull() {
            addCriterion("restore_time is not null");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeEqualTo(Date value) {
            addCriterionForJDBCDate("restore_time =", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeNotEqualTo(Date value) {
            addCriterionForJDBCDate("restore_time <>", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeGreaterThan(Date value) {
            addCriterionForJDBCDate("restore_time >", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("restore_time >=", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeLessThan(Date value) {
            addCriterionForJDBCDate("restore_time <", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeLessThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("restore_time <=", value, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeIn(List<Date> values) {
            addCriterionForJDBCDate("restore_time in", values, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeNotIn(List<Date> values) {
            addCriterionForJDBCDate("restore_time not in", values, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("restore_time between", value1, value2, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andRestoreTimeNotBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("restore_time not between", value1, value2, "restoreTime");
            return (Criteria) this;
        }

        public Criteria andEnableIsNull() {
            addCriterion("enable is null");
            return (Criteria) this;
        }

        public Criteria andEnableIsNotNull() {
            addCriterion("enable is not null");
            return (Criteria) this;
        }

        public Criteria andEnableEqualTo(Byte value) {
            addCriterion("enable =", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableNotEqualTo(Byte value) {
            addCriterion("enable <>", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableGreaterThan(Byte value) {
            addCriterion("enable >", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableGreaterThanOrEqualTo(Byte value) {
            addCriterion("enable >=", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableLessThan(Byte value) {
            addCriterion("enable <", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableLessThanOrEqualTo(Byte value) {
            addCriterion("enable <=", value, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableIn(List<Byte> values) {
            addCriterion("enable in", values, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableNotIn(List<Byte> values) {
            addCriterion("enable not in", values, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableBetween(Byte value1, Byte value2) {
            addCriterion("enable between", value1, value2, "enable");
            return (Criteria) this;
        }

        public Criteria andEnableNotBetween(Byte value1, Byte value2) {
            addCriterion("enable not between", value1, value2, "enable");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}